package com.link2room.aeriabots.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by LN on 2016/10/31.
 */
@Entity
@Table(name = "wx_promotion_transfers_log")
@DynamicInsert
public class WxPromotionTransfersLog extends BaseEntity{
    private String appid;
    private String openid;
    private String partnerTradeNo;
    private String paymentNo;
    private String resultCode;
    private String reqXml;
    private String resXml;

    @Basic
    @Column(name = "appid", nullable = true, length = 32)
    public String getAppid() {
        return appid;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    @Basic
    @Column(name = "openid", nullable = true, length = 64)
    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    @Basic
    @Column(name = "partner_trade_no", nullable = true, length = 32)
    public String getPartnerTradeNo() {
        return partnerTradeNo;
    }

    public void setPartnerTradeNo(String partnerTradeNo) {
        this.partnerTradeNo = partnerTradeNo;
    }

    @Basic
    @Column(name = "payment_no", nullable = true, length = 64)
    public String getPaymentNo() {
        return paymentNo;
    }

    public void setPaymentNo(String paymentNo) {
        this.paymentNo = paymentNo;
    }

    @Basic
    @Column(name = "result_code", nullable = true, length = 16)
    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    @Basic
    @Column(name = "reqXML", nullable = true, length = 1024)
    public String getReqXml() {
        return reqXml;
    }

    public void setReqXml(String reqXml) {
        this.reqXml = reqXml;
    }

    @Basic
    @Column(name = "resXML", nullable = true, length = 1024)
    public String getResXml() {
        return resXml;
    }

    public void setResXml(String resXml) {
        this.resXml = resXml;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        WxPromotionTransfersLog that = (WxPromotionTransfersLog) o;

        if (appid != null ? !appid.equals(that.appid) : that.appid != null) return false;
        if (openid != null ? !openid.equals(that.openid) : that.openid != null) return false;
        if (partnerTradeNo != null ? !partnerTradeNo.equals(that.partnerTradeNo) : that.partnerTradeNo != null)
            return false;
        if (paymentNo != null ? !paymentNo.equals(that.paymentNo) : that.paymentNo != null) return false;
        if (resultCode != null ? !resultCode.equals(that.resultCode) : that.resultCode != null) return false;
        if (reqXml != null ? !reqXml.equals(that.reqXml) : that.reqXml != null) return false;
        if (resXml != null ? !resXml.equals(that.resXml) : that.resXml != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = appid != null ? appid.hashCode() : 0;
        result = 31 * result + (openid != null ? openid.hashCode() : 0);
        result = 31 * result + (partnerTradeNo != null ? partnerTradeNo.hashCode() : 0);
        result = 31 * result + (paymentNo != null ? paymentNo.hashCode() : 0);
        result = 31 * result + (resultCode != null ? resultCode.hashCode() : 0);
        result = 31 * result + (reqXml != null ? reqXml.hashCode() : 0);
        result = 31 * result + (resXml != null ? resXml.hashCode() : 0);
        return result;
    }
}
